function ajax(url){
    fetch(url).then(data=>data.json()).then(data=>dataGen.next(data));
}
function * steps(){
    console.log('fetching beers');  // fetch主动发送请求
    const beers = yield ajax('http://api.react.beer/v2/search?q=hops&type=beer');
    console.log(beers);
    const wes = yield ajax("http://api.githup.com/users/wesbos");
    console.log(wes);
    const fatJoe=yield ajax("https://api.discogs.com/artists/51980");
    console.log(fatJoe);
}
const dataGen=steps();
dataGen.next();